<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function fn(a){
            this.a = a
        }
        var obj={}
        var getNum = fn.bind(obj);
        getNum(2);
        console.log(obj.a);
        console.log('-------------');
        //使用递归求到20的斐波那契数列之和
        function sum(n) {
            function fb(n) { 
             if (n<=2&&n!=0) {
                 return 1
             }else if(n===0){
              return 0 ;
             }
             else{
              return fb(n-1)+fb(n-2)  ;
             }
             
         }
            if (n===0) {
                return 0;
            }
           if (n>=1) {
            return sum(n-1) +fb(n);
           }
         
        }
         
         console.log(sum(20));
  
    </script>
</body>
</html>